<?php
    include "coupon.php";

$username=$_REQUEST['username'];
$couponid=$_REQUEST['couponid'];
$couponname=$_REQUEST['couponname'];
$coupontype=$_REQUEST['coupontype'];
$priceone=$_REQUEST['priceone'];
$pricetwo=$_REQUEST['pricetwo'];
$startdate=$_REQUEST['startdate'];
$enddate=$_REQUEST['enddate'];
$rule=$_REQUEST['rule'];

mysqli_select_db($conn,"shopping");

$sql =  "insert into user_coupon(username,couponid,couponname,coupontype,priceone,pricetwo,startdate,enddate,rule) 
values ('$username','$couponid','$couponname','$coupontype','$priceone','$pricetwo','$startdate','$enddate','$rule')";
//SQL模板

   $result=mysqli_query($conn,$sql);

    if (!$result){
        echo '数据更新失败！';
    }else{
        echo '数据更新成功！';
    }
    
    mysqli_close($conn);
?>
